//
//  MainMenu.m
//  Pocket Doctor alpha version
//
//  Created by Sherif, Yin, Taylor, Jacob, Anna, Mike on 11-10-25.
//  Copyright (c) 2011 __Sytjam__. All rights reserved.
//
//Class Description: - Main Menu; this is where everything happens.
//                     all views are accessible from here (except first time launch)
//                     emergency contact is loaded and ready to use (if set up)
//                     next reminder is loaded and displayed at the bottom.
//                   - Easiest way to check medications and times is through Calendar.
//                   - Editing must be done from medicine view
//
//Known Bugs: 
//  - Nearby Pharmacy may ask more than once for location verification (even if you say no).
//  - When receiving a notification and the application is open and you are on main menu view              the next reminder is not refreshed with it.
//            - Reminders displayed are only those saved in the local notification (so, if you have a reminder due tomorrow; after the notification goes off; the next reminder will display "no upcoming reminders" BUT; in reality... the reminder will fire next week as well.
//

#import <UIKit/UIKit.h>
@class Passcode;
@class Preferences;
@class LogKeeper;
@class MedSearch;
@class Information;
@class AppDelegate;
@class NearbyPharmacy;

@interface MainMenu : UIViewController <UIAlertViewDelegate, UIWebViewDelegate>{
    
    //Class View
    Passcode *pc;
    Preferences *sets;
    LogKeeper *log;
    MedSearch *ms;
    Information *about;
    AppDelegate *aD;
    NearbyPharmacy *np;
    
    
    //Buttons and labels
    UIButton *meds;
    UIButton *cal;
    UIButton *pharm;
    UIButton *history; //log (place in settings)
    UIButton *Search; //search online (replace later)
    UIButton *settings;
    UIButton *emergency;
    UIButton *info;
    UIButton *nextReminder;
    UILabel *nextReminderLabel;
    UILabel *emergencyNumber;
    UILabel *emergencyInstructions;
    UIImageView *emergencyArrows;
    UIImageView *URLActionImage;
    UIWebView *webView;
    UILabel *testingConnection;
    UIActivityIndicatorView *activityIndicator;
    
    int tryURL;
}

@property (retain, nonatomic) Passcode *pc;
@property (retain, nonatomic) Preferences *sets;
@property (retain, nonatomic) LogKeeper *log;
@property (retain, nonatomic) MedSearch *ms;
@property (retain, nonatomic) Information *about;
@property (retain, nonatomic) AppDelegate *aD;
@property (retain, nonatomic) NearbyPharmacy *np;


@property (retain, nonatomic) IBOutlet UIButton *meds;
@property (retain, nonatomic) IBOutlet UIButton *cal;
@property (retain, nonatomic) IBOutlet UIButton *pharm;
@property (retain, nonatomic) IBOutlet UIButton *history;
@property (retain, nonatomic) IBOutlet UIButton *Search;
@property (retain, nonatomic) IBOutlet UIButton *settings;
@property (retain, nonatomic) IBOutlet UIButton *emergency;
@property (retain, nonatomic) IBOutlet UIButton *info;
@property (retain, nonatomic) IBOutlet UIButton *nextReminder;
@property (retain, nonatomic) IBOutlet UILabel *nextReminderLabel;
@property (retain, nonatomic) IBOutlet UILabel *emergencyNumber;
@property (retain, nonatomic) IBOutlet UILabel *emergencyInstructions;
@property (retain, nonatomic) IBOutlet UIImageView *emergencyArrows;
@property (retain, nonatomic) IBOutlet UIImageView *URLActionImage;
@property (retain, nonatomic) IBOutlet UIWebView *webView;
@property (retain, nonatomic) IBOutlet UILabel *testingConnection;
@property (retain, nonatomic) IBOutlet UIActivityIndicatorView *activityIndicator;

@property (nonatomic) int tryURL;

- (IBAction)GoToMedicine:(id)sender;
- (IBAction)GoToCalendar:(id)sender;
- (IBAction)GoToLogs:(id)sender;
- (IBAction)GoToSearch:(id)sender;
- (IBAction)GoToPharmacy:(id)sender;
- (IBAction)GoToPreferences:(id)sender;
- (IBAction)EmergencyButton:(id)sender;
- (IBAction)Information:(id)sender;
- (IBAction)NextReminder:(id)sender;
- (void)EmergencyButtonLetGo:(id)sender;
- (void)displayLabel;
- (void)enableButtons:(BOOL)yn;
- (void)loadNextNotification;
- (void)loadSettings;

@end
